This is a fantastic feature to produce and visualize streams and to verify how various operators work on them.
Have also a look at rxmarbles for interactive visualisations.
ONE DASH IS 100 MILLISECONDS!
In [8]:
%run startup.py
In [9]:
rst(O.from_marbles)
ts = time.time()
# producing a stream
s = O.from_marbles('1-2-3|')
# mapping into real time:
s2 = s.to_blocking()
# adding times
s3 = s2.map(lambda x: 'val: %s, dt: %s' % (x, time.time()-ts))
# subscribing to it:
d = s3.subscribe(print)
In [11]:
rst(rx.core.blockingobservable.BlockingObservable.to_marbles)
s1 = O.from_marbles('1---2-3|')
s2 = O.from_marbles('-a-b-c-|')
print(s1.merge(s2).to_blocking().to_marbles())
In [ ]: